home *** CD-ROM | disk | FTP | other *** search
-
-
- /* Copyright (c) 1993-1996 Algorithms Corporation */
- /* All rights reserved. */
-
-
-
-
- /* This file automatically generated by dpp - do not edit */
-
- #define DPP_STRATEGY 2
- #define DPP_FASTWIDE 0
-
-
-
- #line 17 "setseq.d"
- #include "set1.h"
-
- #define CLASS SetSequence_c
- #define ivType SetSequence_iv_t
-
- #include "generics.h"
-
- object SetSequence_c;
-
-
- #line 28 "setseq.c"
- typedef struct _SetSequence_iv_t {
- int iTabidx;
- int iSize;
- NODE * iTab;
- NODE iCurrent;
- } SetSequence_iv_t;
-
-
-
- #line 27 "setseq.d"
- cmeth objrtn SetSequence_cm_gNewSetSeq(object self, int size, int nelm, void *tab)
- {
- object seq = oSuper(SetSequence_c, gNew, self)(self);
- ivType *iv = ivPtr(seq);
- iv->iSize = size;
- iv->iTab = (NODE *) tab;
- if (nelm) {
- for (; !iv->iTab[iv->iTabidx] ; ++iv->iTabidx);
- iv->iCurrent = iv->iTab[iv->iTabidx];
- }
- return seq;
- }
-
- imeth objrtn SetSequence_im_gNext(object self)
- { SetSequence_iv_t *iv = GetIVs(SetSequence, self);
- NODE n;
- if (n = iv->iCurrent) {
- if (!(iv->iCurrent = iv->iCurrent->next))
- while (++iv->iTabidx < iv->iSize)
- if (iv->iTab[iv->iTabidx]) {
- iv->iCurrent = iv->iTab[iv->iTabidx];
- break;
- }
- return n->luk;
- }
- return gDispose(self);
- }
-
-
- #line 68 "setseq.c"
-
- objrtn SetSequence_initialize(void)
- {
- static CRITICALSECTION cs;
- static int volatile once = 0;
-
- ENTERCRITICALSECTION(_CI_CS_);
- if (!once) {
- INITIALIZECRITICALSECTION(cs);
- once = 1;
- }
- LEAVECRITICALSECTION(_CI_CS_);
-
- ENTERCRITICALSECTION(cs);
-
- if (SetSequence_c) {
- LEAVECRITICALSECTION(cs);
- return SetSequence_c;
- }
- INHIBIT_THREADER;
- Sequence_initialize();
- if (SetSequence_c) {
- ENABLE_THREADER;
- LEAVECRITICALSECTION(cs);
- return SetSequence_c;
- }
- SetSequence_c = gNewClass(Class, "SetSequence", sizeof(SetSequence_iv_t), 0, Sequence, END);
- cMethodFor(SetSequence, gNewSetSeq, SetSequence_cm_gNewSetSeq);
- iMethodFor(SetSequence, gNext, SetSequence_im_gNext);
-
- ENABLE_THREADER;
-
- LEAVECRITICALSECTION(cs);
-
- return SetSequence_c;
- }
-
-
-
-